#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
int m;
int cnt=1;
int len;
int a[20];
int u[105],v[105],w[105];
signed main(){
	freopen("road.in","r",stdin);
	freopen("road.out","w",stdout);
	scanf("%lld",&n);
	for(int i=1;i<=15;i++) a[i]=i+1;
	a[16]=114;
	for(int i=15,j=1;i>=1;i--,j*=2){
		len++;
		u[len]=a[i];v[len]=a[i+1];w[len]=0;
		len++;
		u[len]=a[i];v[len]=a[i+1];w[len]=j;
	}
	int s=0;
	n++;
	for(int i=15;i>=0;i--){
		if((n>>i)&1){
			len++;
			u[len]=1;v[len]=a[16-i];w[len]=s;
			s+=(1ll<<i);
		}
	}
	printf("17 %lld\n",len);
	for(int i=1;i<=len;i++) printf("%lld %lld %lld\n",u[i],v[i],w[i]);
	return 0;
}